package com.example.iotest.bio.piped;


import org.junit.Test;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.Arrays;

public class Test5 {
    public static void insertionSort(int[] numbers) {
        int len = numbers.length;
        int temp = 0;
        for (int i = 1; i < len - 1; i++) {
            for (int j = i; j > 0; j--) {
                temp = numbers[j];
                if (temp < numbers[j - 1]) {
                    numbers[j] = numbers[j - 1];
                    numbers[j - 1] = temp;
                }
            }
        }
        System.out.println(Arrays.toString(numbers));
    }

    public static void main(String[] args) {
        int[] arr = {15, 84, 63, 82, 8, 39, 98, 1, 13, 21};
//        int[] arr = {15};
        insertionSort(arr);
        byte a=(byte)11111111111111111110.6f;
        System.out.println((byte)0b10000000);
    }

    @Test
    public void f1() throws IOException {
        FileInputStream fileInputStream=new FileInputStream("target/classes/files/1.txt");
        ByteBuffer buffer=ByteBuffer.allocate(1024);
        int read = fileInputStream.read(buffer.array());
        System.out.println(Arrays.toString(buffer.array()));
        System.out.println(new String(buffer.array(),0, buffer.capacity()));
        System.out.println(Integer.MAX_VALUE+Integer.MAX_VALUE);
    }
}
